<?php
namespace lib\db;
class DBRec
{
    private $arr=array();
    public  $str;
    public function __construct($arr)
    {
        if (is_array($arr))
        {
            $this->arr=$arr;
        }
    }
    public function __toString()
    {
        foreach ($this->arr  as $key=> $v)
        {
            $this->str.=$key.'='.$v;
          // return  implode($this->arr);
        }
        return $this->str;
      // implode( array_keys($this->arr));
        //return implode(' ',$this->arr);
    }
    public function __get($name)
    {
        if (!isset($this->arr[$name]))return false;
        return $this->arr[$name];
    }
    public function __set($name, $value)
    {
       $this->arr[$name]=$value;
    }

}